package com.huawei.util;

import com.alibaba.fastjson.JSON;

public class Result {
	private int code;
	private String msg;
	private int count;
	private Object data;

	public Result(int code, String msg, int count, Object data) {
		this.code = code;
		this.msg = msg;
		this.count = count;
		this.data = data;
	}

	public Result(int count, Object data) {
		this.code = 0;
		this.msg = "success";
		this.count = count;
		this.data = data;

	}

	public Result(int code, String msg) {
		this.code = 1;
		this.msg = msg;

	}

	public String toJson() {

		return JSON.toJSONString(this);
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}


}
